// Mod 缩写
let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let CR = (id, x) => MOD("create", id, x)
let CRA = (id, x) => MOD("createaddition", id, x)
let TC = (id, x) => MOD("tconstruct", id, x)
let MC = (id, x) => MOD("minecraft", id, x)
let KJ = (id, x) => MOD("kubejs", id, x)
let FD = (id, x) => MOD("farmersdelight", id, x)
let BOP = (id, x) => MOD("biomesoplenty", id, x)
let SD = (id, x) => MOD("storagedrawers", id, x)
let SP = (id, x) => MOD("supplementaries", id, x)
let F = (id, x) => MOD("forge", id, x)
let OCC = (id, x) => MOD("occultism", id, x)
let MEK = (id, x) => MOD("mekanism", id, x)
let MEKG = (id, x) => MOD("mekanismgenerators", id, x)
let MEKT = (id, x) => MOD("mekanismtools", id, x)
let IF = (id, x) => MOD("industrialforegoing", id, x)
let TAC = (id, x) => MOD("tac", id, x)
let FAA = (id, x) => MOD("forbidden_arcanus", id, x)
let DC = (id, x) => MOD("druidcraft", id, x)
let IAF = (id, x) => MOD("iceandfire", id, x)
let TM = (id, x) => MOD("torchmaster", id, x)
let AR = (id, x) => MOD("doomangelring", id, x)
let TE = (id, x) => MOD("thermal", id, x)
let PW = (id, x) => MOD("powah", id, x)
let RS = (id, x) => MOD("refinedstorage", id, x)
let PZ = (id, x) => MOD("pipez", id, x)
let TLM = (id, x) => MOD("touhou_little_maid", id, x)
let CO = (id, x) => MOD("crossroads", id, x)
let UG = (id, x) => MOD("undergarden", id, x)
let VC = (id, x) => MOD("vanillacookbook", id, x)
//
onEvent('recipes', event => {
	
//下界岩产线
event.recipes.createCrushing([
Item.of(MC("netherrack"), 4).withChance(0.8),
Item.of(MC("gold_ingot")).withChance(0.15),
Item.of(MC("egg")).withChance(0.05)
], KJ('ocean_cupcake')).processingTime(250).id('eow:mysterious_crushing')

event.shaped(Item.of(PZ('item_pipe'), 8), [
		'KKK',
		'BSB',
		'KKK'
	], {
		B: CR('brass_funnel'),
		K: MC('dried_kelp'),
		S: UG('ditchbulb')
	}).id('eow:pipez_item_pipe')

event.recipes.createFilling(CR("electron_tube"), 
[CR('polished_rose_quartz'), Fluid.of(TC('molten_iron'), 16)]).id('eow:cabfill_electron_tube')

event.remove({output: TC('seared_melter')})
event.shaped(TC('seared_melter'), [
		'AAA',
		'KSK',
		'KKK'
	], {
		A: CR('andesite_alloy'),
		S: TC('#tanks'),
		K: TC('seared_brick')
	}).id('eow:seared_melter')
	
event.campfireCooking(MC('coal'), UG('ditchbulb')).cookingTime(300).id('eow:more_coal')

   let ingots = ['copper']   
   let mod = 'create'
     
for (let i of ingots) {
         
event.replaceOutput({}, `#forge:ingots/${i}`, `${mod}:${i}_ingot`)
         
event.replaceOutput({}, `#forge:nuggets/${i}`, `${mod}:${i}_nugget`)
         
event.replaceOutput({}, `#forge:storage_blocks/${i}`, `${mod}:${i}_block`)
    }
	



event.custom({
  "type": "interactio:item_fluid_transform",
  "inputs": [
    {
      "item": "minecraft:dirt",
      "count": 2
    },
    {
      "item": "minecraft:sugar",
      "count": 2
    },
    {
      "item": "minecraft:sand",
      "count": 1
    }
  ],
  "fluid": {
    "fluid": "kubejs:rotten_solution"
  },
  "output": {
    "item": "minecraft:dirt",
    "count": 4
  }
}).id('eow:dirt_duplicate')
})

//鸡变幻翼
onEvent('item.entity_interact', event => {
              if (event.target.type == 'minecraft:chicken' 
              && event.target.block == 'kubejs:rotten_solution'
			  && event.player.getHeldItem(event.hand) == 'minecraft:rotten_flesh')
                     {
						 
					event.server.runCommandSilent(`/playsound minecraft:ambient.underwater.enter master @p ~0 0 0 16 1.0 0`)
					event.server.runCommandSilent(`/setblock ${event.target.block.x} ${event.target.block.y} ${event.target.block.z} minecraft:air`)
					event.server.runCommandSilent(`/summon minecraft:phantom ${event.target.x} ${event.target.y} ${event.target.z}`)
					event.target.y=-70
                     }            
})
